package com.zxw.controller;


import com.zxw.service.IStorageTblService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zxw
 * @since 2020-10-16
 */
@RestController
@RequestMapping("/storage-tbl")
@Slf4j
public class StorageTblController {

    @Autowired
    private IStorageTblService storageService;

    @RequestMapping(value = "/deduct", produces = "application/json")
    public Boolean deduct(String commodityCode, Integer count) throws InterruptedException {
//        log.info("获取到打印");
        Thread.sleep(5000);
        storageService.deduct(commodityCode, count);
        return true;
    }
}
